package com.tofacebook.spring.jdbc.model;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Arrays;
import java.util.List;
import java.util.Map;


/**
 * 这是lombok jar包提供的一个注解，作用是，
 * 给我们一些getter ,setter,toString
 * ,有参构造方法，无参构造方  等等，免去写这种代码的实现
 */
//@NoArgsConstructor  //无参构造方法
//@AllArgsConstructor //全参数构造方法
public class Emp {

    private  final static Logger log = LoggerFactory.getLogger(Emp.class);
    //类的成员变量
    private Long empId;
    private String empName;
    private Integer age;
    private String sex;

    private String[] values;//定义字符串的数组，也就说使用setter去给他注入值

    private List<Dept> deptList;

    private Map<String,Dept> deptMap;

    public Emp() {
    }

    public Emp(Long empId, String empName, Integer age, String sex, String[] values, List<Dept> deptList, Map<String, Dept> deptMap) {
        this.empId = empId;
        this.empName = empName;
        this.age = age;
        this.sex = sex;
        this.values = values;
        this.deptList = deptList;
        this.deptMap = deptMap;
    }

    public Emp(Long empId, String empName, Integer age, String sex, String[] values, List<Dept> deptList) {
        this.empId = empId;
        this.empName = empName;
        this.age = age;
        this.sex = sex;
        this.values = values;
        this.deptList = deptList;
    }


    //在当前对象里面只定义有参构造方法，没有指明无参的构造方法，当我们使用ioc容器去构造的
    //实例对象的时候就会报错，提示：没有提供无参构造方法

    public static Logger getLog() {
        return log;
    }

    public Long getEmpId() {
        return empId;
    }

    public void setEmpId(Long empId) {
        this.empId = empId;
    }

    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String[] getValues() {
        return values;
    }

    public void setValues(String[] values) {
        this.values = values;
    }

    public List<Dept> getDeptList() {
        return deptList;
    }

    public void setDeptList(List<Dept> deptList) {
        this.deptList = deptList;
    }

    public Map<String, Dept> getDeptMap() {
        return deptMap;
    }

    public void setDeptMap(Map<String, Dept> deptMap) {
        this.deptMap = deptMap;
    }

    @Override
    public String toString() {
        return "Emp{" +
                "empId=" + empId +
                ", empName='" + empName + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                ", values=" + Arrays.toString(values) +
                ", deptList=" + deptList +
                ", deptMap=" + deptMap +
                '}';
    }

}
